const defaultState = {
    login:localStorage['login']||'false',
    userInfo:{
        uid:'',
        cellphone:'',
        nickname:'昵称',
        utype:'',
        gender:'',
        head:'',
        points:'0'
    }
}
export default (state=defaultState,action)=>{
    switch (action.type) {
        case'login':
            // return {login: action.value}
            // return Object.assign({}, state, {
            //     login: action.value
            // })
            // let newState = JSON.parse(JSON.stringify(state))
            // newState.login = action.value
            // return newState

            return Object.assign({}, state, {
                login :action.value
            })
        case'setuser':
            return Object.assign({}, state, {
                userInfo: action.value
            })
        default:
            return state
    }

}